home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="ISO-8859-1"?>
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>
- <!-- Run this stylesheet against Test.xml -->
- <!-- The output from this stylesheet may seem unexpected -->
- <!-- as there is text in it that was not specifically -->
- <!-- requested. -->
- <!-- This is because the XSLT built-in rules have also -->
- <!-- been applied to all A elements. To show that the -->
- <!-- built-in rules are being applied - ensure that you -->
- <!-- have the 'Include (debug) XSLT built-in rules' -->
- <!-- option turned on (Environment Options - Debugger tab) -->
- <!-- and run a debug on this stylesheet. -->
- <xsl:template match="/">
- <root>
- <xsl:apply-templates select="root/A"/>
- </root>
- </xsl:template>
-
- <!-- only select A elements that have a child B element -->
- <!-- where the B element text contains the word 'SHOULD' -->
- <xsl:template match="A[B[contains(text(),'SHOULD')]]">
- <xsl:copy-of select="."/>
- </xsl:template>
- </xsl:stylesheet>
-